Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: [DHIS2-18116] check return value of parseDate #3823

Merged
merged 2 commits into from
Oct 4, 2024
Merged

Conversation

superskip
Copy link
Contributor

@superskip superskip commented Oct 1, 2024

DHIS2-18116

The bug occurred because there was missing validation of the return value from parseDate.

There are other occurrences of parseDate (and parseTime) in the same file, but for some reason the obvious way to trigger these functions does not work, and therefore I don't know when or if they ever get called.

EDIT:
Regarding how to trigger the other functions, see comment below (thanks @simonadomnisoru)

@superskip superskip requested a review from a team as a code owner October 1, 2024 08:26
@simonadomnisoru
Copy link
Contributor

simonadomnisoru commented Oct 2, 2024

There are other occurrences of parseDate (and parseTime) in the same file, but for some reason the obvious way to trigger these functions does not work, and therefore I don't know when or if they ever get called.

Hi @superskip,
From Maintenance, you can create a tracking entity attribute of type DATETIME and another of type TIME. Then, add them to the TB program attributes list. They should be visible in Capture on the 'Create New Person' registration page for the TB program. Typing a letter in these fields will call the other parseDate/parseTime occurrences form convertDateTime and convertTime.

@superskip
Copy link
Contributor Author

They should be visible in Capture on the 'Create New Person' registration page for the TB program. Typing a letter in these fields will call the other parseDate/parseTime occurrences form convertDateTime and convertTime.

@simonadomnisoru - I only tested in the edit profile modal..! But that one certainly uses a different file.. Thanks for double checking, great discovery! 🕵️

Copy link

github-actions bot commented Oct 3, 2024

Copy link

@geethaalwan geethaalwan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested successfully on 2.42,2.41.2,2.40.6,2.39.7 versions

@superskip superskip merged commit a1626e0 into master Oct 4, 2024
45 checks passed
@superskip superskip deleted the DHIS2-18116 branch October 4, 2024 13:55
dhis2-bot added a commit that referenced this pull request Oct 4, 2024
## [101.7.1](v101.7.0...v101.7.1) (2024-10-04)

### Bug Fixes

* [DHIS2-18116] check return value of `parseDate` ([#3823](#3823)) ([a1626e0](a1626e0))
@dhis2-bot
Copy link
Contributor

🎉 This PR is included in version 101.7.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants